package com.spring.schedule_system.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.spring.schedule_system.dao.*;
import com.spring.schedule_system.entity.*;
import com.spring.schedule_system.utils.JwtToken;
import com.spring.schedule_system.utils.MySchedules;
import com.spring.schedule_system.utils.MyUtil;
import com.spring.schedule_system.utils.ResponseEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.Array;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;

@CrossOrigin
@Controller
@RequestMapping("/schedule")
@Api(value = "ScheduleController", description = "排课表相关api")
public class ScheduleController {
    Boolean flag;
    MyUtil myUtil = new MyUtil();
    @Autowired(required = false)
    private Schedule1Dao schedule1Dao;
    @Autowired
    private CourseDao courseDao;
    @Autowired
    private Tb_classDao tb_classDao;
    @Autowired
    private TeacherDao teacherDao;
    @Autowired
    private ScheduleController scheduleController;


//    /**
//     * 添加排课表
//     * @param class_name
//     * @param classroom_name
//     * @param course_name
//     * @param teacher_name
//     * @param time
//     * @param week
//     * @param Authorization
//     * @return
//     * @throws IOException
//     * @throws TokenExpiredException
//     */
//    @ApiOperation("添加排课表")
//    @PostMapping("/web/addSchedule")
//    @ResponseBody
//    public ResponseEntity addSchedule(@RequestParam(required = true) String class_name,
//                                   @RequestParam(required = true) String classroom_name,
//                                   @RequestParam(required = true) String course_name,
//                                   @RequestParam(required = true) String teacher_name,
//                                   @RequestParam(required = true) Date time,
//                                   @RequestParam(required = true) String week,
//                                   @RequestHeader String Authorization) throws IOException, TokenExpiredException {
//        ResponseEntity responseEntity;
//        String token = Authorization;
//        //判断token是否存在或过期
//        if (flag = myUtil.judgeToken(token)){
//            responseEntity = ResponseEntity.forbidden();
//            responseEntity.putDataValue("msg","token不存在或已过期");
//            return responseEntity;
//        }
//        User user = JwtToken.unsign(token, User.class);
//        //用户角色，分微信用户和老师用户，1代表微信用户，2代表老师用户,默认为微信用户
//        if (user.getUser_role()!=2){
//            responseEntity = ResponseEntity.unauthorized();
//            responseEntity.putDataValue("msg","权限错误");
//            responseEntity.putDataValue("timestamp",myUtil.getTime());
//            return responseEntity;
//        }
//        //根据user_jobNumber查询数据库是否有该用户存在，不存在则注册，存在则注册失败
//        QueryWrapper<Schedule> queryWrapper = new QueryWrapper<>();
//        queryWrapper.eq("teacher_name", teacher_name);
//        Schedule schedule= scheduleDao.selectOne(queryWrapper);
//        //User userFromBase = userDao.selectById(user_name);
//        if (schedule == null){
//            responseEntity = ResponseEntity.ok();
//            Tb_class tb_class1 = new Tb_class();
//            tb_class1.setClass_code(class_code);
//            tb_class1.setClass_count(class_count);
//            tb_class1.setClass_name(class_name);
//            tb_class1.setClass_profession(class_profession);
//            tb_class1.setGrade(grade);
//            tb_classDao.insert(tb_class1);
//            responseEntity.putDataValue("class_id",tb_class1.getClass_id());
//            responseEntity.putDataValue("msg","班级注册成功");
//        }else {
//            responseEntity = ResponseEntity.badRequest();
//            responseEntity.putDataValue("msg","班级注册失败");
//        }
//        return responseEntity;
//    }
//

//
//    /**
//     * 手动调课--根据schedule_id查询教室
//     * @param schedule_id
//     * @return
//     * @throws IOException
//     */
//    @ApiOperation("手动调课--根据schedule_id查询教室")
//    @PutMapping("/web/updateScheduleBySchedule_id")
//    @ResponseBody
//    public ResponseEntity selectBySchedule_id(@RequestParam(required = true) Integer schedule_id) throws IOException {
//        ResponseEntity responseEntity;
//        responseEntity=ResponseEntity.ok();
//        Schedule1 schedule1 = schedule1Dao.selectById(schedule_id);
//        String others_classroom = schedule1.getOthers_classroom();
//        String[] split = others_classroom.split("、");
//        List<String> list = new ArrayList();
//        for (int i = 0; i < split.length; i++) {
//            list.add(split[i]);
//        }
//        responseEntity.putDataValue("list", list);
//        return responseEntity;
//    }
//
//    /**
//     * 手动调课--根据Scheduled_classroom查询教室
//     * @param scheduled_classroom
//     * @return
//     * @throws IOException
//     */
//    @ApiOperation("手动调课--根据Scheduled_classroom查询教室（还不行）")
//    @PutMapping("/web/updateScheduleByScheduled_classroom")
//    @ResponseBody
//    public ResponseEntity selectByScheduled_classroom(@RequestParam(required = true) String scheduled_classroom) throws IOException {
//        ResponseEntity responseEntity;
//        responseEntity=ResponseEntity.ok();
//        List<String> list = new ArrayList<>();
//        ResponseEntity responseEntity1 = scheduleController.selectByScheduled_classroom(scheduled_classroom);
//        int code = responseEntity1.getCode();
//        QueryWrapper<Schedule1> queryWrapper = new QueryWrapper<>();
//        queryWrapper.eq("scheduled_classroom", scheduled_classroom);
//        List<Schedule1> schedule = schedule1Dao.selectList(queryWrapper);
//        List<HashMap> lts = MySchedules.findAll(schedule);
//        for (HashMap<String,List<Schedule1>> hashMap: lts) {
//            List<Schedule1> schedule1s = hashMap.get("周期");
//            for (Schedule1 schedule1 : schedule1s) {
//                if (schedule1.getWeeks().isEmpty()) {
//                    list.add(schedule1.getWeeks());
//                }
//            }
//
//        }
//        responseEntity.putDataValue("周期", list);
//        return responseEntity;
//    }
//
//    /**
//     * 手动调课--根据number_sections查询教室
//     * @param scheduled_classroom
//     * @return
//     * @throws IOException
//     */
//    @ApiOperation("手动调课--根据number_sections教室（还不行）")
//    @PutMapping("/web/updateScheduleBynumber_sections")
//    @ResponseBody
//    public ResponseEntity selectBynumber_sections(@RequestParam(required = true) String scheduled_classroom) throws IOException {
//        ResponseEntity responseEntity;
//        responseEntity=ResponseEntity.ok();
//        List<String> list = new ArrayList<>();
//        QueryWrapper<Schedule1> queryWrapper = new QueryWrapper<>();
//        queryWrapper.eq("scheduled_classroom", scheduled_classroom);
//        List<Schedule1> schedule = schedule1Dao.selectList(queryWrapper);
//        List<HashMap> lts = MySchedules.findAll(schedule);
//        for (HashMap<String,List<Schedule1>> hashMap: lts) {
//            List<Schedule1> schedule1List = hashMap.get("节数");
//            for (Schedule1 schedule1 : schedule1List) {
//                if (schedule1.getWeeks().isEmpty()) {
//                    list.add(schedule1.getNumber_sections());
//                }
//            }
//
//        }
//        responseEntity.putDataValue("节数", list);
//        return responseEntity;
//    }

    /**
     * 删除第几周的一个课程(调课需要的接口)（成功）
     * @param schedule_id
     * @param xiugaizhoushu
     * @return
     */
    @ApiOperation("删除第几周的一个课程(调课需要的接口 )（成功）")
    @PostMapping("/web/tiaoke")
    @ResponseBody
    public ResponseEntity tiaoke(@RequestParam(required = true)int schedule_id,@RequestParam(required = true)String xiugaizhoushu){
        ResponseEntity responseData;
        responseData = ResponseEntity.ok();
        //删除某星期的数据
        Schedule1 schedule = schedule1Dao.selectById(schedule_id);
        //System.out.println("原数据"+schedule);
        String class_weeks=schedule.getClass_weeks();//上课周数
        if(class_weeks.length()==1){
            schedule1Dao.deleteById(schedule_id);
            responseData.putDataValue("msg", "删除第几周的某个课程成功");
            return responseData;
        }else{
            String arr[]=class_weeks.split("、");
            //String xiugaizhoushu = "11" ;//2、3、4、5、7、8、9、11
            String str="";
            for (int i = 0; i < arr.length; i++) {
                if(xiugaizhoushu.equals(arr[i])&&i != 0&&i != arr.length-1){//不在第一位以及最后一位然后相同
                    arr[i]="";
                    str+=arr[i];
                }else if(xiugaizhoushu.equals(arr[i])&&i == 0){//第一位相同
                    str="";
                }else  if(xiugaizhoushu.equals(arr[i])&&i == arr.length-1){//最后一位相同
                    arr[i]="";
                    str+=arr[i];
                } else{//不相同将其加起来并拼接上、
                    str+=arr[i]+"、";
                }
            }
            schedule.setClass_weeks(str.substring(0,str.length()-1));
            //System.out.println(str.substring(0,str.length()-1));
            schedule1Dao.updateById(schedule);
            responseData.putDataValue("msg", "删除第几周的某个课程成功");
            return responseData;
        }
    }


    /**
     * 添加一个排课信息成功
     * @param scheduled_classroom
     * @param others_classroom
     * @param number_sections
     * @param weeks
     * @param class_weeks
     * @param course_name
     * @param classes_name
     * @param teacher_name
     * @param Authorization
     * @return
     * @throws IOException
     */
    @ApiOperation("添加一个排课信息（成功）")
    @PostMapping("/web/addTiaoKe")
    @ResponseBody
    public ResponseEntity addTiaoKe(@RequestParam(required = true)String scheduled_classroom,//安排的课室
                                    @RequestParam(required = false)String others_classroom,//其他可用课室
                                    @RequestParam(required = true)String number_sections,//节数
                                    @RequestParam(required = true)String weeks,//星期几
                                    @RequestParam(required = true)String class_weeks,//周数
                                    @RequestParam(required = true)String course_name, //课程名
                                    @RequestParam(required = true)String classes_name,//班级名
                                    @RequestParam(required = true)String teacher_name,//老师名
                                    @RequestHeader String Authorization) throws IOException {
        ResponseEntity responseEntity;
        String token = Authorization;
        if (flag =myUtil.judgeToken(token)) {
            responseEntity = ResponseEntity.forbidden();
            responseEntity.putDataValue("msg", "token不存在或已过期");
            return responseEntity;
        }
        User users = JwtToken.unsign(token, User.class);
        if (users == null) {
            responseEntity = ResponseEntity.notFound();
            responseEntity.putDataValue("msg", "用户不存在");
            return responseEntity;
        } else if (users.getUser_role()!=2) {
            responseEntity = ResponseEntity.unauthorized();
            responseEntity.putDataValue("msg", "没有权限");
            return responseEntity;
        } else {
            responseEntity = ResponseEntity.ok();
            QueryWrapper<Schedule1> queryWrapper1 = new QueryWrapper<>();
            queryWrapper1.eq("weeks", weeks);
            queryWrapper1.like("number_sections", number_sections);
            queryWrapper1.eq("scheduled_classroom", scheduled_classroom);
            List<Schedule1> list1 = schedule1Dao.selectList(queryWrapper1);
            int count = 0;
            if (list1.size() > 0) {
                for (Schedule1 schedule1 : list1) {
                    String class_weeks1 = schedule1.getClass_weeks();
                    if(existZhouShu(class_weeks,class_weeks1)==true){
                        count++;
                    }
                }
                if(count>0){//存在对应的排课信息
                    responseEntity = ResponseEntity.badRequest();
                    responseEntity.putDataValue("msg", "该排课信息已存在");
                    return responseEntity;
                }else{//不存在
                    Schedule1 schedule2 = new Schedule1();
                    schedule2.setScheduled_classroom(scheduled_classroom);
                    schedule2.setOthers_classroom(others_classroom);
                    schedule2.setNumber_sections(number_sections);
                    schedule2.setWeeks(weeks);
                    schedule2.setClass_weeks(class_weeks);
                    schedule2.setCourse_name(course_name);
                    schedule2.setClasses_name(classes_name);
                    schedule2.setTeacher_name(teacher_name);
                    schedule1Dao.insert(schedule2);
                    responseEntity.putDataValue("msg", "添加一个排课信息成功");
                    return responseEntity;
                }
            }else{//不存在
                Schedule1 schedule2 = new Schedule1();
                schedule2.setScheduled_classroom(scheduled_classroom);
                schedule2.setOthers_classroom(others_classroom);
                schedule2.setNumber_sections(number_sections);
                schedule2.setWeeks(weeks);
                schedule2.setClass_weeks(class_weeks);
                schedule2.setCourse_name(course_name);
                schedule2.setClasses_name(classes_name);
                schedule2.setTeacher_name(teacher_name);
                schedule1Dao.insert(schedule2);
                responseEntity.putDataValue("msg", "添加一个排课信息成功");
                return responseEntity;
            }
        }
    }

    /**
     * 判断是否存在对应的周数
     * @param xiugaizhoushu 修改周数
     * @param class_week 原本有的周数
     * @return
     */
    public static boolean existZhouShu(String xiugaizhoushu,String class_week) {

        boolean flag = false;//是否找到相等的
        if (class_week.contains("、")) {//周数里有多周的情况
            String arr[] = class_week.split("、");
            for (int i = 0; i < arr.length; i++) {
                if (arr[i].equals(xiugaizhoushu)) {
                    flag = true;
                }
            }
            if (flag == true) {//包含周数
                return true;
            } else {//不包含周数
                return false;
            }
        } else {//周数里只有1周的情况
            if (xiugaizhoushu.equals(class_week)) {//找到相等
                return true;
            }else{ //不相等
                return false;
            }
        }
    }

    /**
     * 查询某天需要开门的课室
     * @param class_weeks
     * @param weeks
     * @return
     */
    @ApiOperation("查询某天需要开门的课室")
    @PostMapping("/web/selectDayOpenClassroom")
    @ResponseBody
    public ResponseEntity selectDayOpenClassroom(@RequestParam(required = true,defaultValue = "2")String class_weeks,@RequestParam(required = true,defaultValue = "二")String weeks){
        ResponseEntity responseData;
        responseData = ResponseEntity.ok();
        Map<String,List<Schedule1>> map=new HashMap<>();

        QueryWrapper<Schedule1> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.like("class_weeks", class_weeks);
        queryWrapper1.eq("weeks", weeks);
        queryWrapper1.like("number_sections","1、2");
        List<Schedule1> list1=schedule1Dao.selectList(queryWrapper1);
        map.put("第一,二节",list1);

        QueryWrapper<Schedule1> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.like("class_weeks", class_weeks);
        queryWrapper2.eq("weeks", weeks);
        queryWrapper2.like("number_sections","3、4");
        List<Schedule1> list2=schedule1Dao.selectList(queryWrapper2);
        map.put("第三,四节",list2);

        QueryWrapper<Schedule1> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.like("class_weeks", class_weeks);
        queryWrapper3.eq("weeks", weeks);
        queryWrapper3.like("number_sections","5、6");
        List<Schedule1> list3=schedule1Dao.selectList(queryWrapper3);
        map.put("第五,六节",list3);
        //System.out.println(list3);

        QueryWrapper<Schedule1> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.like("class_weeks", class_weeks);
        queryWrapper4.eq("weeks", weeks);
        queryWrapper4.like("number_sections","7、8");
        List<Schedule1> list4=schedule1Dao.selectList(queryWrapper4);
        map.put("第七,八节",list4);
        // System.out.println(list4);

        QueryWrapper<Schedule1> queryWrapper5 = new QueryWrapper<>();
        queryWrapper5.like("class_weeks", class_weeks);
        queryWrapper5.eq("weeks", weeks);
        queryWrapper5.like("number_sections","9、10");
        List<Schedule1> list5=schedule1Dao.selectList(queryWrapper5);
        map.put("第九,十节",list5);
        // System.out.println(list5);

        QueryWrapper<Schedule1> queryWrapper6 = new QueryWrapper<>();
        queryWrapper6.like("class_weeks", class_weeks);
        queryWrapper6.eq("weeks", weeks);
        queryWrapper6.like("number_sections","11、12");
        List<Schedule1> list6=schedule1Dao.selectList(queryWrapper6);
        map.put("第十一,十二节",list6);
        //System.out.println(map);
        //System.out.println(list6);
        responseData.putDataValue("map", map);
        return responseData;
    }


    /**
     * 根据schedule_id查询排课表
     * @param schedule_id
     * @param Authorization
     * @return
     * @throws IOException
     */
    @ApiOperation("根据schedule_id查询排课表")
    @PutMapping("/web/selectByClassId")
    @ResponseBody
    public ResponseEntity selectByClassId(@RequestParam(required = true) Integer schedule_id, @RequestHeader String Authorization) throws IOException {
        ResponseEntity responseEntity;
        String token = Authorization;
        if (flag =myUtil.judgeToken(token)) {
            responseEntity = ResponseEntity.forbidden();
            responseEntity.putDataValue("msg", "token不存在或已过期");
            return responseEntity;
        }
        User users = JwtToken.unsign(token, User.class);
        if (users == null) {
            responseEntity = ResponseEntity.notFound();
            responseEntity.putDataValue("msg", "用户不存在");
            return responseEntity;
        } else  {
            responseEntity=ResponseEntity.ok();
            Schedule1 schedule = schedule1Dao.selectById(schedule_id);
            if (schedule == null){
                responseEntity = ResponseEntity.badRequest();
                responseEntity.putDataValue("msg", "查询的课程表不存在");
                return responseEntity;
            }
            responseEntity.putDataValue("schedule",schedule);
            return responseEntity;
        }
    }

    /**
     * 根据schedule_id删除排课表信息
     * @param schedule_id
     * @param Authorization
     * @return
     * @throws IOException
     */
    @ApiOperation("根据schedule_id删除排课表信息")
    @PutMapping("/web/deleteSchedule")
    @ResponseBody
    public ResponseEntity deleteSchedule(@RequestParam(required = true) Integer schedule_id,@RequestHeader String Authorization)throws IOException{
        ResponseEntity responseEntity;
        String token=Authorization;
        if(flag=myUtil.judgeToken(token)){
            responseEntity=ResponseEntity.forbidden();
            responseEntity.putDataValue("msg","token不存在或已过期");
            return responseEntity;
        }
        User users=JwtToken.unsign(token,User.class);
        if(users==null){
            responseEntity=ResponseEntity.notFound();
            responseEntity.putDataValue("msg","用户不存在");
            return responseEntity;
        }else if(users.getUser_role()==2) {
            Schedule1 schedule = schedule1Dao.selectById(schedule_id);
            if (schedule != null) {
                schedule1Dao.deleteById(schedule_id);
                responseEntity = ResponseEntity.ok();
                responseEntity.putDataValue("msg", "删除成功");
                return responseEntity;
            } else {
                responseEntity = ResponseEntity.badRequest();
                responseEntity.putDataValue("msg", "查询的课程表不存在");
                return responseEntity;

            }
        }
        responseEntity=ResponseEntity.unauthorized();
        responseEntity.putDataValue("msg","没有权限");
        return responseEntity;
    }

    /**
     * 排课列表
     * @param Authorization
     * @param response
     * @return
     * @throws IOException
     */
    @ApiOperation("排课列表")
    @PostMapping("/web/schedulesList")
    @ResponseBody
    public ResponseEntity schedulesList(@RequestHeader String Authorization,
                                       HttpServletResponse response) throws IOException {
        response.setHeader("Access-Control-Allow-Origin", "*");
        /*星号表示所有的域都可以接受，*/
        response.setHeader("Access-Control-Allow-Methods", "GET,POST");

        ResponseEntity responseData;
        String token = Authorization;
        //通过token解密出来的user对象
        User user = JwtToken.unsign(token, User.class);
        //判断token是否存在或过期
        if (flag = myUtil.judgeToken(token)){
            responseData = ResponseEntity.forbidden();
            responseData.putDataValue("msg","token不存在或已过期");
            return responseData;
        }
        QueryWrapper<Schedule1> wrapper = new QueryWrapper<>();
        List<Schedule1> list = schedule1Dao.selectList(wrapper);
        if (list == null){
            responseData = ResponseEntity.badRequest();
            responseData.putDataValue("msg", "查询的课程表不存在");
            return responseData;
        }
        responseData = ResponseEntity.ok();
        responseData.putDataValue("Schedule",list);
        responseData.putDataValue("msg","成功");
        return responseData;
    }
    /**
     * 根据班级名查询排课表
     * @param classes_name
     * @param Authorization
     * @return
     * @throws IOException
     */
    @ApiOperation("根据班级名查询排课表")
    @PutMapping("/web/selectByClassName")
    @ResponseBody
    public ResponseEntity selectByClassName(@RequestParam(required = true) String classes_name, @RequestHeader String Authorization) throws IOException {
        ResponseEntity responseEntity;
        String token = Authorization;
        if (flag =myUtil.judgeToken(token)) {
            responseEntity = ResponseEntity.forbidden();
            responseEntity.putDataValue("msg", "token不存在或已过期");
            return responseEntity;
        }
        User users = JwtToken.unsign(token, User.class);
        if (users == null) {
            responseEntity = ResponseEntity.notFound();
            responseEntity.putDataValue("msg", "用户不存在");
            return responseEntity;
        } else {
            responseEntity=ResponseEntity.ok();
            QueryWrapper<Schedule1> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("classes_name", classes_name);
            List<Schedule1> schedule = schedule1Dao.selectList(queryWrapper);
            List<HashMap> lts = MySchedules.findAll(schedule);
            if (lts == null){
                responseEntity = ResponseEntity.badRequest();
                responseEntity.putDataValue("msg", "查询的课程表不存在");
                return responseEntity;
            }
            responseEntity.putDataValue("lists",lts);
            return responseEntity;
        }
    }
    /**
     * 根据教师查询排课表
     * @param teacher_name
     * @param Authorization
     * @return
     * @throws IOException
     */
    @ApiOperation("根据教师查询排课表")
    @PutMapping("/web/selectByTeacherName")
    @ResponseBody
    public ResponseEntity selectByTeacherName(@RequestParam(required = true) String teacher_name, @RequestHeader String Authorization) throws IOException {
        ResponseEntity responseEntity;
        String token = Authorization;
        if (flag =myUtil.judgeToken(token)) {
            responseEntity = ResponseEntity.forbidden();
            responseEntity.putDataValue("msg", "token不存在或已过期");
            return responseEntity;
        }
        User users = JwtToken.unsign(token, User.class);
        if (users == null) {
            responseEntity = ResponseEntity.notFound();
            responseEntity.putDataValue("msg", "用户不存在");
            return responseEntity;
        } else {
            responseEntity=ResponseEntity.ok();
            QueryWrapper<Schedule1> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("teacher_name", teacher_name);
            List<Schedule1> schedule = schedule1Dao.selectList(queryWrapper);
            List<HashMap> lts = MySchedules.findAll(schedule);
            if (lts == null){
                responseEntity = ResponseEntity.badRequest();
                responseEntity.putDataValue("msg", "查询的课程表不存在");
                return responseEntity;
            }
            responseEntity.putDataValue("lists",lts);
            return responseEntity;
        }

    }
    /**
     * 根据教室查询排课表
     * @param scheduled_classroom
     * @param Authorization
     * @return
     * @throws IOException
     */
    @ApiOperation("根据教室查询排课表")
    @PutMapping("/web/selectByClassroomName")
    @ResponseBody
    public ResponseEntity selectByClassroomName(@RequestParam(required = true) String scheduled_classroom, @RequestHeader String Authorization) throws IOException {
        ResponseEntity responseEntity;
        String token = Authorization;
        if (flag =myUtil.judgeToken(token)) {
            responseEntity = ResponseEntity.forbidden();
            responseEntity.putDataValue("msg", "token不存在或已过期");
            return responseEntity;
        }
        User users = JwtToken.unsign(token, User.class);
        if (users == null) {
            responseEntity = ResponseEntity.notFound();
            responseEntity.putDataValue("msg", "用户不存在");
            return responseEntity;
        } else {
            responseEntity=ResponseEntity.ok();
            QueryWrapper<Schedule1> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("scheduled_classroom", scheduled_classroom);
            List<Schedule1> schedule = schedule1Dao.selectList(queryWrapper);
            List<HashMap> lts = MySchedules.findAll(schedule);
            if (lts == null){
                responseEntity = ResponseEntity.badRequest();
                responseEntity.putDataValue("msg", "查询的课程表不存在");
                return responseEntity;
            }
            responseEntity.putDataValue("lists",lts);
            return responseEntity;
        }

    }

    /**
     * 根据周期查询排课表
     * @param class_weeks
     * @param Authorization
     * @return
     * @throws IOException
     */
    @ApiOperation("根据周期查询排课表")
    @PutMapping("/web/selectByClass_weeks")
    @ResponseBody
    public ResponseEntity selectByTime(@RequestParam(required = true) String class_weeks, @RequestHeader String Authorization) throws IOException {
        ResponseEntity responseEntity;
        String token = Authorization;
        if (flag =myUtil.judgeToken(token)) {
            responseEntity = ResponseEntity.forbidden();
            responseEntity.putDataValue("msg", "token不存在或已过期");
            return responseEntity;
        }
        User users = JwtToken.unsign(token, User.class);
        if (users == null) {
            responseEntity = ResponseEntity.notFound();
            responseEntity.putDataValue("msg", "用户不存在");
            return responseEntity;
        } else {
            responseEntity=ResponseEntity.ok();
            QueryWrapper<Schedule1> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("class_weeks", class_weeks);
            List<Schedule1> schedule = schedule1Dao.selectList(queryWrapper);
            if (schedule == null){
                responseEntity = ResponseEntity.badRequest();
                responseEntity.putDataValue("msg", "查询的课程表不存在");
                return responseEntity;
            }
            responseEntity.putDataValue("schedule",schedule);
            return responseEntity;
        }

    }


    /**
     * 统计排课表数量
     */
    @ApiOperation("统计排课表数量")
    @GetMapping("/web/count")
    @ResponseBody
    public ResponseEntity count() throws IOException {
        ResponseEntity responseData;
//        int is_delete = 0;
//        QueryWrapper<Schedule> queryWrapper = new QueryWrapper<>();
//        queryWrapper.eq("is_delete", is_delete);
        int  count =schedule1Dao.selectCount(null);
        responseData = ResponseEntity.ok();
        responseData.putDataValue("count", count);
        return responseData;
    }
    /**
     * 批量删除排课表
     * @param arr
     * @param Authorization
     * @return
     */
    @ApiOperation("批量删除排课表")
    @GetMapping("/web/deleteScheduleList")
    @ResponseBody
    public ResponseEntity deleteScheduleList(@RequestParam(required = true) int[] arr,
                                          @RequestHeader String Authorization ) throws  IOException{
        ResponseEntity responseData;
        String token = Authorization;
        //通过token解密出来的user对象
        User user = JwtToken.unsign(token, User.class);
        //判断token是否存在或过期
        if (flag = myUtil.judgeToken(token)){
            responseData = ResponseEntity.forbidden();
            responseData.putDataValue("msg","token不存在或已过期");
            return responseData;
        }
        if (user.getUser_role()!=2){
            responseData = ResponseEntity.badRequest();
            responseData.putDataValue("msg","权限错误");
            responseData.putDataValue("timestamp",myUtil.getTime());
            return responseData;
        }
        for (int schedule_id : arr) {
            Schedule1 schedule = schedule1Dao.selectById(schedule_id);
            if (schedule != null) {
                schedule1Dao.deleteById(schedule_id);
            }
        }
        responseData = ResponseEntity.ok();
        responseData.putDataValue("msg", "批量删除数据成功");
        return responseData;


    }

    /**
     * 导入教学计划
     * @param myfile 教学计划Excel文件
     * @return
     * @throws Exception
     */
    @ApiOperation("导入教学计划")
    @PostMapping("/web/importExcel")
    @ResponseBody
    public  ResponseEntity importExcel(@RequestParam(required = true)MultipartFile myfile) throws Exception {
        ResponseEntity responseData;
        Workbook workbook = null;
        String fileName = myfile.getOriginalFilename();
        if (fileName.endsWith("xls")){
            //2003
            workbook = new HSSFWorkbook(myfile.getInputStream());
        }else if (fileName.endsWith("xlsx")){
            //2007
            workbook = new XSSFWorkbook(myfile.getInputStream());
        }else {
            throw new Exception("文件不是Excel文件");
        }

        Sheet sheet = workbook.getSheet("上课信息统计");
//        Workbook workbook = new XSSFWorkbook("C:\\Users\\Lenovo\\Desktop\\paike.xlsx");
//        //获取表
//        Sheet sheet = workbook.getSheet("Sheet1");
        int rows = sheet.getLastRowNum();//行数

        for (int i = 1; i <= rows+1 ; i++) {
            Row row = sheet.getRow(i);
            if (row !=null){
                Schedule1 schedule1 = new Schedule1();
                String others_classroom = getCellValue(row.getCell(0));
                schedule1.setOthers_classroom(others_classroom);
                String scheduled_classroom = getCellValue(row.getCell(1));
                schedule1.setScheduled_classroom(scheduled_classroom);
                String course_name = getCellValue(row.getCell(2));
                schedule1.setCourse_name(course_name);
                String course_num = getCellValue(row.getCell(3));
                schedule1.setCourse_num(course_num);
                String course_nature = getCellValue(row.getCell(4));
                schedule1.setCourse_nature(course_nature);
                String course_category = getCellValue(row.getCell(5));
                schedule1.setCourse_category(course_category);
                String classes_name = getCellValue(row.getCell(6));
                schedule1.setClasses_name(classes_name);
                Integer person_numbers = Integer.parseInt(getCellValue(row.getCell(7)));
                schedule1.setPerson_numbers(person_numbers);
                String teacher_name = getCellValue(row.getCell(8));
                schedule1.setTeacher_name(teacher_name);
                String class_weeks = getCellValue(row.getCell(9));
                schedule1.setClass_weeks(class_weeks);
                String weeks = getCellValue(row.getCell(10));
                schedule1.setWeeks(weeks);
                String number_sections = getCellValue(row.getCell(11));
                schedule1.setNumber_sections(number_sections);
                String course_computerTime = getCellValue(row.getCell(12));
                schedule1.setCourse_computerTime(course_computerTime);
                String remarks = getCellValue(row.getCell(13));
                schedule1.setRemarks(remarks);
                schedule1Dao.insert(schedule1);
                System.out.println(schedule1);

            }
        }
        courseDao.insertCourse();
        tb_classDao.insertClass();
        teacherDao.insertTeacher();
        responseData = ResponseEntity.ok();
        responseData.putDataValue("msg", "导入成功");

        return responseData;
    }
    private String getCellValue(Cell cell){
        String value = "";
        if (cell != null){
            switch (cell.getCellType()){
                case HSSFCell.CELL_TYPE_NUMERIC:
                    value = cell.getNumericCellValue() + "";
                    if (HSSFDateUtil.isCellDateFormatted(cell)){
                        Date date = cell.getDateCellValue();
                        if (date != null){
                            value = new SimpleDateFormat("yyyy-MM-dd").format(date);
                        }else {
                            value = "";
                        }
                    }else {
                        value = new DecimalFormat("0").format(cell.getNumericCellValue());
                    }
                    break;
                case HSSFCell.CELL_TYPE_STRING:
                    value = cell.getStringCellValue();
                    break;
                case HSSFCell.CELL_TYPE_BOOLEAN:
                    value = cell.getBooleanCellValue()+"";
                    break;
                case HSSFCell.CELL_TYPE_FORMULA:
                    value = cell.getCellFormula()+ "";
                    break;
                case HSSFCell.CELL_TYPE_BLANK:
                    value ="";
                    break;
                case HSSFCell.CELL_TYPE_ERROR:
                    value = "非法字符";
                    break;
                default:
                    value = "未知类型";
                    break;

            }
        }
        return value.trim();
    }



    /**
     * 根据教室导出这个地点一学期的课程表信息
     * @param scheduled_classroom
     * @return
     * @throws IOException
     */
    @ApiOperation("根据教室导出这个地点一学期的课程表信息")
    @PostMapping("/web/exportExcelByClassroom")
    @ResponseBody
    public ResponseEntity exportExcelByClassroom(HttpServletResponse response ,@RequestParam(required = true)String scheduled_classroom) throws IOException {
        response.setCharacterEncoding("UTF-8");
        HSSFWorkbook wb = new HSSFWorkbook();
        HSSFSheet sheet = wb.createSheet("Sheet1");
        //excel第一行
        HSSFRow row = sheet.createRow(0);
        HSSFCellStyle style = wb.createCellStyle();
        style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
        //excel的第一行第一列

        HSSFCell cell = row.createCell(0);
        cell.setCellValue("课时");
        cell = row.createCell(1);
        cell.setCellValue("周一");
        cell.setCellStyle(style);
        cell = row.createCell(2);
        cell.setCellValue("周二");
        cell.setCellStyle(style);
        cell = row.createCell(3);
        cell.setCellValue("周三");
        cell.setCellStyle(style);
        cell = row.createCell(4);
        cell.setCellValue("周四");
        cell.setCellStyle(style);
        cell = row.createCell(5);
        cell.setCellValue("周五");
        cell.setCellStyle(style);

        //excel第二行
        row = sheet.createRow(1);
        //第一列
        cell = row.createCell(0);
        cell.setCellValue("第1、2节课");
        //第二列
        cell = row.createCell(1);
        QueryWrapper<Schedule1> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper.like("number_sections","1、2");
        queryWrapper.eq("weeks","一");
        Schedule1 schedule1 = schedule1Dao.selectOne(queryWrapper);
        //System.out.println(schedule1.getTeacher_name()+"\n"+schedule1.getClass_weeks()+"\n"+schedule1.getCourse_name());
        if(schedule1 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule1.getTeacher_name()+"\n"+schedule1.getClass_weeks()+"\n"+schedule1.getCourse_name());
        }

        //第三列
        cell = row.createCell(2);
        QueryWrapper<Schedule1> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper1.like("number_sections","1、2");
        queryWrapper1.eq("weeks","二");
        Schedule1 schedule2 = schedule1Dao.selectOne(queryWrapper1);
        if(schedule2 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule2.getTeacher_name()+"\n"+schedule2.getClass_weeks()+"\n"+schedule2.getCourse_name());
        }

        //第四列
        cell = row.createCell(3);
        QueryWrapper<Schedule1> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper2.like("number_sections","1、2");
        queryWrapper2.eq("weeks","三");
        Schedule1 schedule3 = schedule1Dao.selectOne(queryWrapper2);
        if(schedule3 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule3.getTeacher_name()+"\n"+schedule3.getClass_weeks()+"\n"+schedule3.getCourse_name());
        }
        //第五列
        cell = row.createCell(4);
        QueryWrapper<Schedule1> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper3.like("number_sections","1、2");
        queryWrapper3.eq("weeks","四");
        Schedule1 schedule4 = schedule1Dao.selectOne(queryWrapper3);
        if(schedule4 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule4.getTeacher_name()+"\n"+schedule4.getClass_weeks()+"\n"+schedule4.getCourse_name());
        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper4.like("number_sections","1、2");
        queryWrapper4.eq("weeks","五");
        Schedule1 schedule5 = schedule1Dao.selectOne(queryWrapper4);
        if(schedule5 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule5.getTeacher_name()+"\n"+schedule5.getClass_weeks()+"\n"+schedule5.getCourse_name());
        }

        //excel第三行
        row = sheet.createRow(2);
        cell = row.createCell(0);
        cell.setCellValue("第3、4节课");
        //第二列
        cell = row.createCell(1);
        QueryWrapper<Schedule1> queryWrapper5 = new QueryWrapper<>();
        queryWrapper5.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper5.like("number_sections","3、4");
        queryWrapper5.eq("weeks","一");
        Schedule1 schedule6 = schedule1Dao.selectOne(queryWrapper5);
        if(schedule6 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule6.getTeacher_name()+"\n"+schedule6.getClass_weeks()+"\n"+schedule6.getCourse_name());
        }
        //第三列
        cell = row.createCell(2);
        QueryWrapper<Schedule1> queryWrapper6 = new QueryWrapper<>();
        queryWrapper6.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper6.like("number_sections","3、4");
        queryWrapper6.eq("weeks","二");
        Schedule1 schedule7= schedule1Dao.selectOne(queryWrapper6);
        if(schedule7 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule7.getTeacher_name()+"\n"+schedule7.getClass_weeks()+"\n"+schedule7.getCourse_name());
        }
        //第四列
        cell = row.createCell(3);
        QueryWrapper<Schedule1> queryWrapper7 = new QueryWrapper<>();
        queryWrapper7.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper7.like("number_sections","3、4");
        queryWrapper7.eq("weeks","三");
        Schedule1 schedule8 = schedule1Dao.selectOne(queryWrapper7);
        if(schedule8  == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule8.getTeacher_name()+"\n"+schedule8.getClass_weeks()+"\n"+schedule8.getCourse_name());
        }
        //第五列
        cell = row.createCell(4);
        QueryWrapper<Schedule1> queryWrapper8 = new QueryWrapper<>();
        queryWrapper8.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper8.like("number_sections","3、4");
        queryWrapper8.eq("weeks","四");
        Schedule1 schedule9 = schedule1Dao.selectOne(queryWrapper8);
        if(schedule9 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule9.getTeacher_name()+"\n"+schedule9.getClass_weeks()+"\n"+schedule9.getCourse_name());
        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper9= new QueryWrapper<>();
        queryWrapper9.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper9.like("number_sections","3、4");
        queryWrapper9.eq("weeks","五");
        Schedule1 schedule10 = schedule1Dao.selectOne(queryWrapper9);
        if(schedule10 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule10.getTeacher_name()+"\n"+schedule10.getClass_weeks()+"\n"+schedule10.getCourse_name());
        }


        //excel第四行
        row = sheet.createRow(3);
        cell = row.createCell(0);
        cell.setCellValue("第5、6节课");
        //第二列
        cell = row.createCell(1);
        QueryWrapper<Schedule1> queryWrapper11 = new QueryWrapper<>();
        queryWrapper11.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper11.like("number_sections","5、6");
        queryWrapper11.eq("weeks","一");
        Schedule1 schedule11 = schedule1Dao.selectOne(queryWrapper11);
        if(schedule11 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule11.getTeacher_name()+"\n"+schedule11.getClass_weeks()+"\n"+schedule11.getCourse_name());
        }
        //第三列
        cell = row.createCell(2);
        QueryWrapper<Schedule1> queryWrapper12 = new QueryWrapper<>();
        queryWrapper12.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper12.like("number_sections","5、6");
        queryWrapper12.eq("weeks","二");
        Schedule1 schedule12 = schedule1Dao.selectOne(queryWrapper12);
        if(schedule12 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule12.getTeacher_name()+"\n"+schedule12.getClass_weeks()+"\n"+schedule12.getCourse_name());
        }
        //第四列
        cell = row.createCell(3);
        QueryWrapper<Schedule1> queryWrapper13= new QueryWrapper<>();
        queryWrapper13.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper13.like("number_sections","5、6");
        queryWrapper13.eq("weeks","三");
        Schedule1 schedule13 = schedule1Dao.selectOne(queryWrapper13);
        if(schedule13 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule13.getTeacher_name()+"\n"+schedule13.getClass_weeks()+"\n"+schedule13.getCourse_name());
        }
        //第五列
        cell = row.createCell(4);
        QueryWrapper<Schedule1> queryWrapper14 = new QueryWrapper<>();
        queryWrapper14.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper14.like("number_sections","5、6");
        queryWrapper14.eq("weeks","四");
        List<Schedule1> schedule14 = schedule1Dao.selectList(queryWrapper14);
        if(schedule14 == null){
            cell.setCellValue("");
        }else{
            String str="";
            for(int i=0;i<schedule14.size();i++){
                str+=schedule14.get(i).getTeacher_name()+"\n"+schedule14.get(i).getClass_weeks()+"\n"+schedule14.get(i).getCourse_name();
                //System.out.println(str);
            }
            cell.setCellValue(str);
        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper15 = new QueryWrapper<>();
        queryWrapper15.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper15.like("number_sections","5、6");
        queryWrapper15.eq("weeks","五");
        Schedule1 schedule15 = schedule1Dao.selectOne(queryWrapper15);
        if(schedule15 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule15.getTeacher_name()+"\n"+schedule15.getClass_weeks()+"\n"+schedule15.getCourse_name());

        }


        //excel第五行
        row = sheet.createRow(4);
        cell = row.createCell(0);
        cell.setCellValue("第7、8节课");
        //第二列
        cell = row.createCell(1);
        QueryWrapper<Schedule1> queryWrapper16 = new QueryWrapper<>();
        queryWrapper16.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper16.like("number_sections","7、8");
        queryWrapper16.eq("weeks","一");
        Schedule1 schedule16 = schedule1Dao.selectOne(queryWrapper16);
        if(schedule16 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule16.getTeacher_name()+"\n"+schedule16.getClass_weeks()+"\n"+schedule16.getCourse_name());

        }
        //第三列
        cell = row.createCell(2);
        QueryWrapper<Schedule1> queryWrapper17 = new QueryWrapper<>();
        queryWrapper17.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper17.like("number_sections","7、8");
        queryWrapper17.eq("weeks","二");
        Schedule1 schedule17= schedule1Dao.selectOne(queryWrapper17);
        if(schedule17 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule17.getTeacher_name()+"\n"+schedule17.getClass_weeks()+"\n"+schedule17.getCourse_name());

        }
        //第四列
        cell = row.createCell(3);
        QueryWrapper<Schedule1> queryWrapper18 = new QueryWrapper<>();
        queryWrapper18.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper18.like("number_sections","7、8");
        queryWrapper18.eq("weeks","三");
        Schedule1 schedule18 = schedule1Dao.selectOne(queryWrapper7);
        if(schedule18==null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule18.getTeacher_name()+"\n"+schedule18.getClass_weeks()+"\n"+schedule18.getCourse_name());

        }
        //第五列
        cell = row.createCell(4);
        QueryWrapper<Schedule1> queryWrapper19 = new QueryWrapper<>();
        queryWrapper19.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper19.like("number_sections","7、8");
        queryWrapper19.eq("weeks","四");
        Schedule1 schedule19 = schedule1Dao.selectOne(queryWrapper8);
        if(schedule19 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule19.getTeacher_name()+"\n"+schedule19.getClass_weeks()+"\n"+schedule19.getCourse_name());

        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper20= new QueryWrapper<>();
        queryWrapper20.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper20.like("number_sections","7、8");
        queryWrapper20.eq("weeks","五");
        Schedule1 schedule20 = schedule1Dao.selectOne(queryWrapper20);
        if(schedule20 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule20.getTeacher_name()+"\n"+schedule20.getClass_weeks()+"\n"+schedule20.getCourse_name());

        }

        //excel第六行
        row = sheet.createRow(5);
        cell = row.createCell(0);
        cell.setCellValue("第9、10节课");
        //第二列
        cell = row.createCell(1);

        QueryWrapper<Schedule1> queryWrapper21 = new QueryWrapper<>();
        queryWrapper21.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper21.like("number_sections","9、10");
        queryWrapper21.eq("weeks","一");
        Schedule1 schedule21 = schedule1Dao.selectOne(queryWrapper21);
        if(schedule21 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule21.getTeacher_name()+"\n"+schedule21.getClass_weeks()+"\n"+schedule21.getCourse_name());

        }
        //第三列
        cell = row.createCell(2);
        QueryWrapper<Schedule1> queryWrapper22 = new QueryWrapper<>();
        queryWrapper22.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper22.like("number_sections","9、10");
        queryWrapper22.eq("weeks","二");
        Schedule1 schedule22 = schedule1Dao.selectOne(queryWrapper6);
        if(schedule22 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule22.getTeacher_name()+"\n"+schedule22.getClass_weeks()+"\n"+schedule22.getCourse_name());

        }
        //第四列
        cell = row.createCell(3);

        QueryWrapper<Schedule1> queryWrapper23 = new QueryWrapper<>();
        queryWrapper23.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper23.like("number_sections","9、10");
        queryWrapper23.eq("weeks","三");
        Schedule1 schedule23 = schedule1Dao.selectOne(queryWrapper23);
        if(schedule23 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule23.getTeacher_name()+"\n"+schedule23.getClass_weeks()+"\n"+schedule23.getCourse_name());

        }
        //第五列
        cell = row.createCell(4);

        QueryWrapper<Schedule1> queryWrapper24 = new QueryWrapper<>();
        queryWrapper24.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper24.like("number_sections","9、10");
        queryWrapper24.eq("weeks","四");
        Schedule1 schedule24 = schedule1Dao.selectOne(queryWrapper24);
        if(schedule24 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule24.getTeacher_name()+"\n"+schedule24.getClass_weeks()+"\n"+schedule24.getCourse_name());

        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper25= new QueryWrapper<>();
        queryWrapper25.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper25.like("number_sections","9、10");
        queryWrapper25.eq("weeks","五");
        Schedule1 schedule25 = schedule1Dao.selectOne(queryWrapper25);
        if(schedule25 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule25.getTeacher_name()+"\n"+schedule25.getClass_weeks()+"\n"+schedule25.getCourse_name());

        }

        //excel第七行
        row = sheet.createRow(6);
        cell = row.createCell(0);
        cell.setCellValue("第11、12节课");
        //第二列
        cell = row.createCell(1);

        QueryWrapper<Schedule1> queryWrapper26 = new QueryWrapper<>();
        queryWrapper26.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper26.like("number_sections","11");
        queryWrapper26.eq("weeks","一");
        Schedule1 schedule26 = schedule1Dao.selectOne(queryWrapper26);
        if(schedule26 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule26.getTeacher_name()+"\n"+schedule26.getClass_weeks()+"\n"+schedule26.getCourse_name());

        }
        //第三列
        cell = row.createCell(2);

        QueryWrapper<Schedule1> queryWrapper27 = new QueryWrapper<>();
        queryWrapper27.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper27.like("number_sections","11");
        queryWrapper27.eq("weeks","二");
        Schedule1 schedule27 = schedule1Dao.selectOne(queryWrapper27);
        if(schedule27==null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule27.getTeacher_name()+"\n"+schedule27.getClass_weeks()+"\n"+schedule27.getCourse_name());

        }
        //第四列
        cell = row.createCell(3);

        QueryWrapper<Schedule1> queryWrapper28 = new QueryWrapper<>();
        queryWrapper28.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper28.like("number_sections","11");
        queryWrapper28.eq("weeks","三");
        Schedule1 schedule28 = schedule1Dao.selectOne(queryWrapper28);
        if(schedule28==null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule28.getTeacher_name()+"\n"+schedule28.getClass_weeks()+"\n"+schedule28.getCourse_name());

        }
        //第五列
        cell = row.createCell(4);

        QueryWrapper<Schedule1> queryWrapper29 = new QueryWrapper<>();
        queryWrapper29.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper29.like("number_sections","11");
        queryWrapper29.eq("weeks","四");
        Schedule1 schedule29 = schedule1Dao.selectOne(queryWrapper29);
        if(schedule29==null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule29.getTeacher_name()+"\n"+schedule29.getClass_weeks()+"\n"+schedule29.getCourse_name());

        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper30= new QueryWrapper<>();
        queryWrapper30.eq("scheduled_classroom", scheduled_classroom);
        queryWrapper30.like("number_sections","11");
        queryWrapper30.eq("weeks","五");
        Schedule1 schedule30 = schedule1Dao.selectOne(queryWrapper30);
        if(schedule30==null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule30.getTeacher_name()+"\n"+schedule30.getClass_weeks()+"\n"+schedule30.getCourse_name());
        }

        long filename = System.currentTimeMillis();
        SimpleDateFormat df = new SimpleDateFormat("yyMMddHHmmss");
        String fileName = df.format(new Date());
        response.setContentType("application/msexcel");
        response.setHeader("Content-disposition", "attachment; filename="+fileName+".xls");
        response.flushBuffer();
        wb.write(response.getOutputStream());
        ResponseEntity responseEntity;
        responseEntity=ResponseEntity.ok();
        responseEntity.putDataValue("msg","导出成功");
        return responseEntity;
    }


    /**
     * 根据班级导出这个班级一学期的课程表信息
     * @param classes_name
     * @return
     * @throws IOException
     */
    @ApiOperation("根据班级导出这个班级一学期的课程表信息")
    @PostMapping("/web/exportExcelByClass")
    @ResponseBody
    public ResponseEntity exportExcelByClass(HttpServletResponse response ,@RequestParam(required = true)String classes_name) throws IOException {
        response.setCharacterEncoding("UTF-8");
        HSSFWorkbook wb = new HSSFWorkbook();
        HSSFSheet sheet = wb.createSheet("Sheet1");
        //excel第一行
        HSSFRow row = sheet.createRow(0);
        HSSFCellStyle style = wb.createCellStyle();
        style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
        //excel的第一行第一列

        HSSFCell cell = row.createCell(0);
        cell.setCellValue("课时");
        cell = row.createCell(1);
        cell.setCellValue("周一");
        cell.setCellStyle(style);
        cell = row.createCell(2);
        cell.setCellValue("周二");
        cell.setCellStyle(style);
        cell = row.createCell(3);
        cell.setCellValue("周三");
        cell.setCellStyle(style);
        cell = row.createCell(4);
        cell.setCellValue("周四");
        cell.setCellStyle(style);
        cell = row.createCell(5);
        cell.setCellValue("周五");
        cell.setCellStyle(style);

        //excel第二行
        row = sheet.createRow(1);
        //第一列
        cell = row.createCell(0);
        cell.setCellValue("第1、2节课");
        //第二列
        cell = row.createCell(1);
        QueryWrapper<Schedule1> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("classes_name", classes_name);
        queryWrapper.like("number_sections","1、2");
        queryWrapper.eq("weeks","一");
        Schedule1 schedule1 = schedule1Dao.selectOne(queryWrapper);
        //System.out.println(schedule1.getTeacher_name()+"\n"+schedule1.getClass_weeks()+"\n"+schedule1.getCourse_name());
        if(schedule1 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule1.getTeacher_name()+"\n"+schedule1.getClass_weeks()+"\n"+schedule1.getCourse_name()+"\n"+schedule1.getScheduled_classroom());
        }

        //第三列
        cell = row.createCell(2);
        QueryWrapper<Schedule1> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.eq("classes_name", classes_name);
        queryWrapper1.like("number_sections","1、2");
        queryWrapper1.eq("weeks","二");
        Schedule1 schedule2 = schedule1Dao.selectOne(queryWrapper1);
        if(schedule2 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule2.getTeacher_name()+"\n"+schedule2.getClass_weeks()+"\n"+schedule2.getCourse_name()+"\n"+schedule2.getScheduled_classroom());
        }

        //第四列
        cell = row.createCell(3);
        QueryWrapper<Schedule1> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.eq("classes_name", classes_name);
        queryWrapper2.like("number_sections","1、2");
        queryWrapper2.eq("weeks","三");
        Schedule1 schedule3 = schedule1Dao.selectOne(queryWrapper2);
        if(schedule3 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule3.getTeacher_name()+"\n"+schedule3.getClass_weeks()+"\n"+schedule3.getCourse_name()+"\n"+schedule3.getScheduled_classroom());
        }
        //第五列
        cell = row.createCell(4);
        QueryWrapper<Schedule1> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.eq("classes_name", classes_name);
        queryWrapper3.like("number_sections","1、2");
        queryWrapper3.eq("weeks","四");
        Schedule1 schedule4 = schedule1Dao.selectOne(queryWrapper3);
        if(schedule4 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule4.getTeacher_name()+"\n"+schedule4.getClass_weeks()+"\n"+schedule4.getCourse_name()+"\n"+schedule4.getScheduled_classroom());
        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.eq("classes_name", classes_name);
        queryWrapper4.like("number_sections","1、2");
        queryWrapper4.eq("weeks","五");
        Schedule1 schedule5 = schedule1Dao.selectOne(queryWrapper4);
        if(schedule5 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule5.getTeacher_name()+"\n"+schedule5.getClass_weeks()+"\n"+schedule5.getCourse_name()+"\n"+schedule5.getScheduled_classroom());
        }

        //excel第三行
        row = sheet.createRow(2);
        cell = row.createCell(0);
        cell.setCellValue("第3、4节课");
        //第二列
        cell = row.createCell(1);
        QueryWrapper<Schedule1> queryWrapper5 = new QueryWrapper<>();
        queryWrapper5.eq("classes_name", classes_name);
        queryWrapper5.like("number_sections","3、4");
        queryWrapper5.eq("weeks","一");
        Schedule1 schedule6 = schedule1Dao.selectOne(queryWrapper5);
        if(schedule6 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule6.getTeacher_name()+"\n"+schedule6.getClass_weeks()+"\n"+schedule6.getCourse_name()+"\n"+schedule6.getScheduled_classroom());
        }
        //第三列
        cell = row.createCell(2);
        QueryWrapper<Schedule1> queryWrapper6 = new QueryWrapper<>();
        queryWrapper6.eq("classes_name", classes_name);
        queryWrapper6.like("number_sections","3、4");
        queryWrapper6.eq("weeks","二");
        Schedule1 schedule7= schedule1Dao.selectOne(queryWrapper6);
        if(schedule7 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule7.getTeacher_name()+"\n"+schedule7.getClass_weeks()+"\n"+schedule7.getCourse_name()+"\n"+schedule7.getScheduled_classroom());
        }
        //第四列
        cell = row.createCell(3);
        QueryWrapper<Schedule1> queryWrapper7 = new QueryWrapper<>();
        queryWrapper7.eq("classes_name", classes_name);
        queryWrapper7.like("number_sections","3、4");
        queryWrapper7.eq("weeks","三");
        Schedule1 schedule8 = schedule1Dao.selectOne(queryWrapper7);
        if(schedule8  == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule8.getTeacher_name()+"\n"+schedule8.getClass_weeks()+"\n"+schedule8.getCourse_name()+"\n"+schedule8.getScheduled_classroom());
        }
        //第五列
        cell = row.createCell(4);
        QueryWrapper<Schedule1> queryWrapper8 = new QueryWrapper<>();
        queryWrapper8.eq("classes_name", classes_name);
        queryWrapper8.like("number_sections","3、4");
        queryWrapper8.eq("weeks","四");
        Schedule1 schedule9 = schedule1Dao.selectOne(queryWrapper8);
        if(schedule9 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule9.getTeacher_name()+"\n"+schedule9.getClass_weeks()+"\n"+schedule9.getCourse_name()+"\n"+schedule9.getScheduled_classroom());
        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper9= new QueryWrapper<>();
        queryWrapper9.eq("classes_name", classes_name);
        queryWrapper9.like("number_sections","3、4");
        queryWrapper9.eq("weeks","五");
        Schedule1 schedule10 = schedule1Dao.selectOne(queryWrapper9);
        if(schedule10 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule10.getTeacher_name()+"\n"+schedule10.getClass_weeks()+"\n"+schedule10.getCourse_name()+"\n"+schedule10.getScheduled_classroom());
        }


        //excel第四行
        row = sheet.createRow(3);
        cell = row.createCell(0);
        cell.setCellValue("第5、6节课");
        //第二列
        cell = row.createCell(1);
        QueryWrapper<Schedule1> queryWrapper11 = new QueryWrapper<>();
        queryWrapper11.eq("classes_name", classes_name);
        queryWrapper11.like("number_sections","5、6");
        queryWrapper11.eq("weeks","一");
        Schedule1 schedule11 = schedule1Dao.selectOne(queryWrapper11);
        if(schedule11 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule11.getTeacher_name()+"\n"+schedule11.getClass_weeks()+"\n"+schedule11.getCourse_name()+"\n"+schedule11.getScheduled_classroom());
        }
        //第三列
        cell = row.createCell(2);
        QueryWrapper<Schedule1> queryWrapper12 = new QueryWrapper<>();
        queryWrapper12.eq("classes_name", classes_name);
        queryWrapper12.like("number_sections","5、6");
        queryWrapper12.eq("weeks","二");
        Schedule1 schedule12 = schedule1Dao.selectOne(queryWrapper12);
        if(schedule12 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule12.getTeacher_name()+"\n"+schedule12.getClass_weeks()+"\n"+schedule12.getCourse_name()+"\n"+schedule12.getScheduled_classroom());
        }
        //第四列
        cell = row.createCell(3);
        QueryWrapper<Schedule1> queryWrapper13= new QueryWrapper<>();
        queryWrapper13.eq("classes_name", classes_name);
        queryWrapper13.like("number_sections","5、6");
        queryWrapper13.eq("weeks","三");
        Schedule1 schedule13 = schedule1Dao.selectOne(queryWrapper13);
        if(schedule13 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule13.getTeacher_name()+"\n"+schedule13.getClass_weeks()+"\n"+schedule13.getCourse_name()+"\n"+schedule13.getScheduled_classroom());
        }
        //第五列
        cell = row.createCell(4);
        QueryWrapper<Schedule1> queryWrapper14 = new QueryWrapper<>();
        queryWrapper14.eq("classes_name", classes_name);
        queryWrapper14.like("number_sections","5、6");
        queryWrapper14.eq("weeks","四");
        List<Schedule1> schedule14 = schedule1Dao.selectList(queryWrapper14);
        if(schedule14 == null){
            cell.setCellValue("");
        }else{
            String str="";
            for(int i=0;i<schedule14.size();i++){
                str+=schedule14.get(i).getTeacher_name()+"\n"+schedule14.get(i).getClass_weeks()+"\n"+schedule14.get(i).getCourse_name()+"\n"+schedule14.get(i).getScheduled_classroom();
                //System.out.println(str);
            }
            cell.setCellValue(str);
        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper15 = new QueryWrapper<>();
        queryWrapper15.eq("classes_name", classes_name);
        queryWrapper15.like("number_sections","5、6");
        queryWrapper15.eq("weeks","五");
        Schedule1 schedule15 = schedule1Dao.selectOne(queryWrapper15);
        if(schedule15 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule15.getTeacher_name()+"\n"+schedule15.getClass_weeks()+"\n"+schedule15.getCourse_name()+"\n"+schedule15.getScheduled_classroom());

        }


        //excel第五行
        row = sheet.createRow(4);
        cell = row.createCell(0);
        cell.setCellValue("第7、8节课");
        //第二列
        cell = row.createCell(1);
        QueryWrapper<Schedule1> queryWrapper16 = new QueryWrapper<>();
        queryWrapper16.eq("classes_name", classes_name);
        queryWrapper16.like("number_sections","7、8");
        queryWrapper16.eq("weeks","一");
        Schedule1 schedule16 = schedule1Dao.selectOne(queryWrapper16);
        if(schedule16 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule16.getTeacher_name()+"\n"+schedule16.getClass_weeks()+"\n"+schedule16.getCourse_name()+"\n"+schedule16.getScheduled_classroom());

        }
        //第三列
        cell = row.createCell(2);
        QueryWrapper<Schedule1> queryWrapper17 = new QueryWrapper<>();
        queryWrapper17.eq("classes_name", classes_name);
        queryWrapper17.like("number_sections","7、8");
        queryWrapper17.eq("weeks","二");
        Schedule1 schedule17= schedule1Dao.selectOne(queryWrapper17);
        if(schedule17 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule17.getTeacher_name()+"\n"+schedule17.getClass_weeks()+"\n"+schedule17.getCourse_name()+"\n"+schedule17.getScheduled_classroom());

        }
        //第四列
        cell = row.createCell(3);
        QueryWrapper<Schedule1> queryWrapper18 = new QueryWrapper<>();
        queryWrapper18.eq("classes_name", classes_name);
        queryWrapper18.like("number_sections","7、8");
        queryWrapper18.eq("weeks","三");
        Schedule1 schedule18 = schedule1Dao.selectOne(queryWrapper7);
        if(schedule18==null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule18.getTeacher_name()+"\n"+schedule18.getClass_weeks()+"\n"+schedule18.getCourse_name()+"\n"+schedule18.getScheduled_classroom());

        }
        //第五列
        cell = row.createCell(4);
        QueryWrapper<Schedule1> queryWrapper19 = new QueryWrapper<>();
        queryWrapper19.eq("classes_name", classes_name);
        queryWrapper19.like("number_sections","7、8");
        queryWrapper19.eq("weeks","四");
        Schedule1 schedule19 = schedule1Dao.selectOne(queryWrapper8);
        if(schedule19 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule19.getTeacher_name()+"\n"+schedule19.getClass_weeks()+"\n"+schedule19.getCourse_name()+"\n"+schedule19.getScheduled_classroom());

        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper20= new QueryWrapper<>();
        queryWrapper20.eq("classes_name", classes_name);
        queryWrapper20.like("number_sections","7、8");
        queryWrapper20.eq("weeks","五");
        Schedule1 schedule20 = schedule1Dao.selectOne(queryWrapper20);
        if(schedule20 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule20.getTeacher_name()+"\n"+schedule20.getClass_weeks()+"\n"+schedule20.getCourse_name()+"\n"+schedule20.getScheduled_classroom());

        }

        //excel第六行
        row = sheet.createRow(5);
        cell = row.createCell(0);
        cell.setCellValue("第9、10节课");
        //第二列
        cell = row.createCell(1);

        QueryWrapper<Schedule1> queryWrapper21 = new QueryWrapper<>();
        queryWrapper21.eq("classes_name", classes_name);
        queryWrapper21.like("number_sections","9、10");
        queryWrapper21.eq("weeks","一");
        Schedule1 schedule21 = schedule1Dao.selectOne(queryWrapper21);
        if(schedule21 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule21.getTeacher_name()+"\n"+schedule21.getClass_weeks()+"\n"+schedule21.getCourse_name()+"\n"+schedule21.getScheduled_classroom());

        }
        //第三列
        cell = row.createCell(2);
        QueryWrapper<Schedule1> queryWrapper22 = new QueryWrapper<>();
        queryWrapper22.eq("classes_name", classes_name);
        queryWrapper22.like("number_sections","9、10");
        queryWrapper22.eq("weeks","二");
        Schedule1 schedule22 = schedule1Dao.selectOne(queryWrapper6);
        if(schedule22 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule22.getTeacher_name()+"\n"+schedule22.getClass_weeks()+"\n"+schedule22.getCourse_name()+"\n"+schedule22.getScheduled_classroom());

        }
        //第四列
        cell = row.createCell(3);

        QueryWrapper<Schedule1> queryWrapper23 = new QueryWrapper<>();
        queryWrapper23.eq("classes_name", classes_name);
        queryWrapper23.like("number_sections","9、10");
        queryWrapper23.eq("weeks","三");
        Schedule1 schedule23 = schedule1Dao.selectOne(queryWrapper23);
        if(schedule23 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule23.getTeacher_name()+"\n"+schedule23.getClass_weeks()+"\n"+schedule23.getCourse_name()+"\n"+schedule23.getScheduled_classroom());

        }
        //第五列
        cell = row.createCell(4);

        QueryWrapper<Schedule1> queryWrapper24 = new QueryWrapper<>();
        queryWrapper24.eq("classes_name", classes_name);
        queryWrapper24.like("number_sections","9、10");
        queryWrapper24.eq("weeks","四");
        Schedule1 schedule24 = schedule1Dao.selectOne(queryWrapper24);
        if(schedule24 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule24.getTeacher_name()+"\n"+schedule24.getClass_weeks()+"\n"+schedule24.getCourse_name()+"\n"+schedule24.getScheduled_classroom());

        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper25= new QueryWrapper<>();
        queryWrapper25.eq("classes_name", classes_name);
        queryWrapper25.like("number_sections","9、10");
        queryWrapper25.eq("weeks","五");
        Schedule1 schedule25 = schedule1Dao.selectOne(queryWrapper25);
        if(schedule25 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule25.getTeacher_name()+"\n"+schedule25.getClass_weeks()+"\n"+schedule25.getCourse_name()+"\n"+schedule25.getScheduled_classroom());

        }

        //excel第七行
        row = sheet.createRow(6);
        cell = row.createCell(0);
        cell.setCellValue("第11、12节课");
        //第二列
        cell = row.createCell(1);

        QueryWrapper<Schedule1> queryWrapper26 = new QueryWrapper<>();
        queryWrapper26.eq("classes_name", classes_name);
        queryWrapper26.like("number_sections","11");
        queryWrapper26.eq("weeks","一");
        Schedule1 schedule26 = schedule1Dao.selectOne(queryWrapper26);
        if(schedule26 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule26.getTeacher_name()+"\n"+schedule26.getClass_weeks()+"\n"+schedule26.getCourse_name()+"\n"+schedule26.getScheduled_classroom());

        }
        //第三列
        cell = row.createCell(2);

        QueryWrapper<Schedule1> queryWrapper27 = new QueryWrapper<>();
        queryWrapper27.eq("classes_name", classes_name);
        queryWrapper27.like("number_sections","11");
        queryWrapper27.eq("weeks","二");
        Schedule1 schedule27 = schedule1Dao.selectOne(queryWrapper27);
        if(schedule27==null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule27.getTeacher_name()+"\n"+schedule27.getClass_weeks()+"\n"+schedule27.getCourse_name()+"\n"+schedule27.getScheduled_classroom());

        }
        //第四列
        cell = row.createCell(3);

        QueryWrapper<Schedule1> queryWrapper28 = new QueryWrapper<>();
        queryWrapper28.eq("classes_name", classes_name);
        queryWrapper28.like("number_sections","11");
        queryWrapper28.eq("weeks","三");
        Schedule1 schedule28 = schedule1Dao.selectOne(queryWrapper28);
        if(schedule28==null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule28.getTeacher_name()+"\n"+schedule28.getClass_weeks()+"\n"+schedule28.getCourse_name()+"\n"+schedule28.getScheduled_classroom());

        }
        //第五列
        cell = row.createCell(4);

        QueryWrapper<Schedule1> queryWrapper29 = new QueryWrapper<>();
        queryWrapper29.eq("classes_name", classes_name);
        queryWrapper29.like("number_sections","11");
        queryWrapper29.eq("weeks","四");
        Schedule1 schedule29 = schedule1Dao.selectOne(queryWrapper29);
        if(schedule29==null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule29.getTeacher_name()+"\n"+schedule29.getClass_weeks()+"\n"+schedule29.getCourse_name()+"\n"+schedule29.getScheduled_classroom());

        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper30= new QueryWrapper<>();
        queryWrapper30.eq("classes_name", classes_name);
        queryWrapper30.like("number_sections","11");
        queryWrapper30.eq("weeks","五");
        Schedule1 schedule30 = schedule1Dao.selectOne(queryWrapper30);
        if(schedule30==null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule30.getTeacher_name()+"\n"+schedule30.getClass_weeks()+"\n"+schedule30.getCourse_name()+"\n"+schedule30.getScheduled_classroom());
        }


        long filename = System.currentTimeMillis();
        SimpleDateFormat df = new SimpleDateFormat("yyMMddHHmmss");
        String fileName = df.format(new Date());
        response.setContentType("application/msexcel");
        response.setHeader("Content-disposition", "attachment; filename="+fileName+".xls");
        response.flushBuffer();
        wb.write(response.getOutputStream());
        ResponseEntity responseEntity;
        responseEntity=ResponseEntity.ok();
        responseEntity.putDataValue("msg","导出成功");
        return responseEntity;
    }
    /**
     * 根据教师导出这个老师一学期的课程表信息
     * @param teacher_name
     * @return
     * @throws IOException
     */
    @ApiOperation("根据教师导出这个老师一学期的课程表信息")
    @PostMapping("/web/exportExcelByTeacher_name")
    @ResponseBody
    public ResponseEntity exportExcelByTeacher_name(HttpServletResponse response ,@RequestParam(required = true)String teacher_name) throws IOException {
        response.setCharacterEncoding("UTF-8");
        HSSFWorkbook wb = new HSSFWorkbook();
        HSSFSheet sheet = wb.createSheet("Sheet1");
        //excel第一行
        HSSFRow row = sheet.createRow(0);
        HSSFCellStyle style = wb.createCellStyle();
        style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
        //excel的第一行第一列

        HSSFCell cell = row.createCell(0);
        cell.setCellValue("课时");
        cell = row.createCell(1);
        cell.setCellValue("周一");
        cell.setCellStyle(style);
        cell = row.createCell(2);
        cell.setCellValue("周二");
        cell.setCellStyle(style);
        cell = row.createCell(3);
        cell.setCellValue("周三");
        cell.setCellStyle(style);
        cell = row.createCell(4);
        cell.setCellValue("周四");
        cell.setCellStyle(style);
        cell = row.createCell(5);
        cell.setCellValue("周五");
        cell.setCellStyle(style);

        //excel第二行
        row = sheet.createRow(1);
        //第一列
        cell = row.createCell(0);
        cell.setCellValue("第1、2节课");
        //第二列
        cell = row.createCell(1);
        QueryWrapper<Schedule1> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("teacher_name", teacher_name);
        queryWrapper.like("number_sections","1、2");
        queryWrapper.eq("weeks","一");
        Schedule1 schedule1 = schedule1Dao.selectOne(queryWrapper);
        //System.out.println(schedule1.getTeacher_name()+"\n"+schedule1.getClass_weeks()+"\n"+schedule1.getCourse_name());
        if(schedule1 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule1.getClasses_name()+"\n"+schedule1.getClass_weeks()+"\n"+schedule1.getCourse_name()+"\n"+schedule1.getScheduled_classroom());
        }

        //第三列
        cell = row.createCell(2);
        QueryWrapper<Schedule1> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.eq("teacher_name", teacher_name);
        queryWrapper1.like("number_sections","1、2");
        queryWrapper1.eq("weeks","二");
        Schedule1 schedule2 = schedule1Dao.selectOne(queryWrapper1);
        if(schedule2 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule2.getClasses_name()+"\n"+schedule2.getClass_weeks()+"\n"+schedule2.getCourse_name()+"\n"+schedule2.getScheduled_classroom());
        }

        //第四列
        cell = row.createCell(3);
        QueryWrapper<Schedule1> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.eq("teacher_name", teacher_name);
        queryWrapper2.like("number_sections","1、2");
        queryWrapper2.eq("weeks","三");
        Schedule1 schedule3 = schedule1Dao.selectOne(queryWrapper2);
        if(schedule3 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule3.getClasses_name()+"\n"+schedule3.getClass_weeks()+"\n"+schedule3.getCourse_name()+"\n"+schedule3.getScheduled_classroom());
        }
        //第五列
        cell = row.createCell(4);
        QueryWrapper<Schedule1> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.eq("teacher_name", teacher_name);
        queryWrapper3.like("number_sections","1、2");
        queryWrapper3.eq("weeks","四");
        Schedule1 schedule4 = schedule1Dao.selectOne(queryWrapper3);
        if(schedule4 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule4.getClasses_name()+"\n"+schedule4.getClass_weeks()+"\n"+schedule4.getCourse_name()+"\n"+schedule4.getScheduled_classroom());
        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.eq("teacher_name", teacher_name);
        queryWrapper4.like("number_sections","1、2");
        queryWrapper4.eq("weeks","五");
        Schedule1 schedule5 = schedule1Dao.selectOne(queryWrapper4);
        if(schedule5 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule5.getClasses_name()+"\n"+schedule5.getClass_weeks()+"\n"+schedule5.getCourse_name()+"\n"+schedule5.getScheduled_classroom());
        }

        //excel第三行
        row = sheet.createRow(2);
        cell = row.createCell(0);
        cell.setCellValue("第3、4节课");
        //第二列
        cell = row.createCell(1);
        QueryWrapper<Schedule1> queryWrapper5 = new QueryWrapper<>();
        queryWrapper5.eq("teacher_name", teacher_name);
        queryWrapper5.like("number_sections","3、4");
        queryWrapper5.eq("weeks","一");
        Schedule1 schedule6 = schedule1Dao.selectOne(queryWrapper5);
        if(schedule6 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule6.getClasses_name()+"\n"+schedule6.getClass_weeks()+"\n"+schedule6.getCourse_name()+"\n"+schedule6.getScheduled_classroom());
        }
        //第三列
        cell = row.createCell(2);
        QueryWrapper<Schedule1> queryWrapper6 = new QueryWrapper<>();
        queryWrapper6.eq("teacher_name", teacher_name);
        queryWrapper6.like("number_sections","3、4");
        queryWrapper6.eq("weeks","二");
        Schedule1 schedule7= schedule1Dao.selectOne(queryWrapper6);
        if(schedule7 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule7.getClasses_name()+"\n"+schedule7.getClass_weeks()+"\n"+schedule7.getCourse_name()+"\n"+schedule7.getScheduled_classroom());
        }
        //第四列
        cell = row.createCell(3);
        QueryWrapper<Schedule1> queryWrapper7 = new QueryWrapper<>();
        queryWrapper7.eq("teacher_name", teacher_name);
        queryWrapper7.like("number_sections","3、4");
        queryWrapper7.eq("weeks","三");
        Schedule1 schedule8 = schedule1Dao.selectOne(queryWrapper7);
        if(schedule8  == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule8.getClasses_name()+"\n"+schedule8.getClass_weeks()+"\n"+schedule8.getCourse_name()+"\n"+schedule8.getScheduled_classroom());
        }
        //第五列
        cell = row.createCell(4);
        QueryWrapper<Schedule1> queryWrapper8 = new QueryWrapper<>();
        queryWrapper8.eq("teacher_name", teacher_name);
        queryWrapper8.like("number_sections","3、4");
        queryWrapper8.eq("weeks","四");
        Schedule1 schedule9 = schedule1Dao.selectOne(queryWrapper8);
        if(schedule9 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule9.getClasses_name()+"\n"+schedule9.getClass_weeks()+"\n"+schedule9.getCourse_name()+"\n"+schedule9.getScheduled_classroom());
        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper9= new QueryWrapper<>();
        queryWrapper9.eq("teacher_name", teacher_name);
        queryWrapper9.like("number_sections","3、4");
        queryWrapper9.eq("weeks","五");
        Schedule1 schedule10 = schedule1Dao.selectOne(queryWrapper9);
        if(schedule10 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule10.getClasses_name()+"\n"+schedule10.getClass_weeks()+"\n"+schedule10.getCourse_name()+"\n"+schedule10.getScheduled_classroom());
        }


        //excel第四行
        row = sheet.createRow(3);
        cell = row.createCell(0);
        cell.setCellValue("第5、6节课");
        //第二列
        cell = row.createCell(1);
        QueryWrapper<Schedule1> queryWrapper11 = new QueryWrapper<>();
        queryWrapper11.eq("teacher_name", teacher_name);
        queryWrapper11.like("number_sections","5、6");
        queryWrapper11.eq("weeks","一");
        Schedule1 schedule11 = schedule1Dao.selectOne(queryWrapper11);
        if(schedule11 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule11.getClasses_name()+"\n"+schedule11.getClass_weeks()+"\n"+schedule11.getCourse_name()+"\n"+schedule11.getScheduled_classroom());
        }
        //第三列
        cell = row.createCell(2);
        QueryWrapper<Schedule1> queryWrapper12 = new QueryWrapper<>();
        queryWrapper12.eq("teacher_name", teacher_name);
        queryWrapper12.like("number_sections","5、6");
        queryWrapper12.eq("weeks","二");
        Schedule1 schedule12 = schedule1Dao.selectOne(queryWrapper12);
        if(schedule12 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule12.getClasses_name()+"\n"+schedule12.getClass_weeks()+"\n"+schedule12.getCourse_name()+"\n"+schedule12.getScheduled_classroom());
        }
        //第四列
        cell = row.createCell(3);
        QueryWrapper<Schedule1> queryWrapper13= new QueryWrapper<>();
        queryWrapper13.eq("teacher_name", teacher_name);
        queryWrapper13.like("number_sections","5、6");
        queryWrapper13.eq("weeks","三");
        Schedule1 schedule13 = schedule1Dao.selectOne(queryWrapper13);
        if(schedule13 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule13.getClasses_name()+"\n"+schedule13.getClass_weeks()+"\n"+schedule13.getCourse_name()+"\n"+schedule13.getScheduled_classroom());
        }
        //第五列
        cell = row.createCell(4);
        QueryWrapper<Schedule1> queryWrapper14 = new QueryWrapper<>();
        queryWrapper14.eq("teacher_name", teacher_name);
        queryWrapper14.like("number_sections","5、6");
        queryWrapper14.eq("weeks","四");
        List<Schedule1> schedule14 = schedule1Dao.selectList(queryWrapper14);
        if(schedule14 == null){
            cell.setCellValue("");
        }else{
            String str="";
            for(int i=0;i<schedule14.size();i++){
                str+=schedule14.get(i).getClasses_name()+"\n"+schedule14.get(i).getClass_weeks()+"\n"+schedule14.get(i).getCourse_name()+"\n"+schedule14.get(i).getScheduled_classroom();
                //System.out.println(str);
            }
            cell.setCellValue(str);
        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper15 = new QueryWrapper<>();
        queryWrapper15.eq("teacher_name", teacher_name);
        queryWrapper15.like("number_sections","5、6");
        queryWrapper15.eq("weeks","五");
        Schedule1 schedule15 = schedule1Dao.selectOne(queryWrapper15);
        if(schedule15 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule15.getClasses_name()+"\n"+schedule15.getClass_weeks()+"\n"+schedule15.getCourse_name()+"\n"+schedule15.getScheduled_classroom());

        }


        //excel第五行
        row = sheet.createRow(4);
        cell = row.createCell(0);
        cell.setCellValue("第7、8节课");
        //第二列
        cell = row.createCell(1);
        QueryWrapper<Schedule1> queryWrapper16 = new QueryWrapper<>();
        queryWrapper16.eq("teacher_name", teacher_name);
        queryWrapper16.like("number_sections","7、8");
        queryWrapper16.eq("weeks","一");
        Schedule1 schedule16 = schedule1Dao.selectOne(queryWrapper16);
        if(schedule16 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule16.getClasses_name()+"\n"+schedule16.getClass_weeks()+"\n"+schedule16.getCourse_name()+"\n"+schedule16.getScheduled_classroom());

        }
        //第三列
        cell = row.createCell(2);
        QueryWrapper<Schedule1> queryWrapper17 = new QueryWrapper<>();
        queryWrapper17.eq("teacher_name", teacher_name);
        queryWrapper17.like("number_sections","7、8");
        queryWrapper17.eq("weeks","二");
        Schedule1 schedule17= schedule1Dao.selectOne(queryWrapper17);
        if(schedule17 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule17.getClasses_name()+"\n"+schedule17.getClass_weeks()+"\n"+schedule17.getCourse_name()+"\n"+schedule17.getScheduled_classroom());

        }
        //第四列
        cell = row.createCell(3);
        QueryWrapper<Schedule1> queryWrapper18 = new QueryWrapper<>();
        queryWrapper18.eq("teacher_name", teacher_name);
        queryWrapper18.like("number_sections","7、8");
        queryWrapper18.eq("weeks","三");
        Schedule1 schedule18 = schedule1Dao.selectOne(queryWrapper7);
        if(schedule18==null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule18.getClasses_name()+"\n"+schedule18.getClass_weeks()+"\n"+schedule18.getCourse_name()+"\n"+schedule18.getScheduled_classroom());

        }
        //第五列
        cell = row.createCell(4);
        QueryWrapper<Schedule1> queryWrapper19 = new QueryWrapper<>();
        queryWrapper19.eq("teacher_name", teacher_name);
        queryWrapper19.like("number_sections","7、8");
        queryWrapper19.eq("weeks","四");
        Schedule1 schedule19 = schedule1Dao.selectOne(queryWrapper8);
        if(schedule19 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule19.getClasses_name()+"\n"+schedule19.getClass_weeks()+"\n"+schedule19.getCourse_name()+"\n"+schedule19.getScheduled_classroom());

        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper20= new QueryWrapper<>();
        queryWrapper20.eq("teacher_name", teacher_name);
        queryWrapper20.like("number_sections","7、8");
        queryWrapper20.eq("weeks","五");
        Schedule1 schedule20 = schedule1Dao.selectOne(queryWrapper20);
        if(schedule20 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule20.getClasses_name()+"\n"+schedule20.getClass_weeks()+"\n"+schedule20.getCourse_name()+"\n"+schedule20.getScheduled_classroom());

        }

        //excel第六行
        row = sheet.createRow(5);
        cell = row.createCell(0);
        cell.setCellValue("第9、10节课");
        //第二列
        cell = row.createCell(1);

        QueryWrapper<Schedule1> queryWrapper21 = new QueryWrapper<>();
        queryWrapper21.eq("teacher_name", teacher_name);
        queryWrapper21.like("number_sections","9、10");
        queryWrapper21.eq("weeks","一");
        Schedule1 schedule21 = schedule1Dao.selectOne(queryWrapper21);
        if(schedule21 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule21.getClasses_name()+"\n"+schedule21.getClass_weeks()+"\n"+schedule21.getCourse_name()+"\n"+schedule21.getScheduled_classroom());

        }
        //第三列
        cell = row.createCell(2);
        QueryWrapper<Schedule1> queryWrapper22 = new QueryWrapper<>();
        queryWrapper22.eq("teacher_name", teacher_name);
        queryWrapper22.like("number_sections","9、10");
        queryWrapper22.eq("weeks","二");
        Schedule1 schedule22 = schedule1Dao.selectOne(queryWrapper6);
        if(schedule22 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule22.getClasses_name()+"\n"+schedule22.getClass_weeks()+"\n"+schedule22.getCourse_name()+"\n"+schedule22.getScheduled_classroom());

        }
        //第四列
        cell = row.createCell(3);

        QueryWrapper<Schedule1> queryWrapper23 = new QueryWrapper<>();
        queryWrapper23.eq("teacher_name", teacher_name);
        queryWrapper23.like("number_sections","9、10");
        queryWrapper23.eq("weeks","三");
        Schedule1 schedule23 = schedule1Dao.selectOne(queryWrapper23);
        if(schedule23 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule23.getClasses_name()+"\n"+schedule23.getClass_weeks()+"\n"+schedule23.getCourse_name()+"\n"+schedule23.getScheduled_classroom());

        }
        //第五列
        cell = row.createCell(4);

        QueryWrapper<Schedule1> queryWrapper24 = new QueryWrapper<>();
        queryWrapper24.eq("teacher_name", teacher_name);
        queryWrapper24.like("number_sections","9、10");
        queryWrapper24.eq("weeks","四");
        Schedule1 schedule24 = schedule1Dao.selectOne(queryWrapper24);
        if(schedule24 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule24.getClasses_name()+"\n"+schedule24.getClass_weeks()+"\n"+schedule24.getCourse_name()+"\n"+schedule24.getScheduled_classroom());

        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper25= new QueryWrapper<>();
        queryWrapper25.eq("teacher_name", teacher_name);
        queryWrapper25.like("number_sections","9、10");
        queryWrapper25.eq("weeks","五");
        Schedule1 schedule25 = schedule1Dao.selectOne(queryWrapper25);
        if(schedule25 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule25.getClasses_name()+"\n"+schedule25.getClass_weeks()+"\n"+schedule25.getCourse_name()+"\n"+schedule25.getScheduled_classroom());

        }

        //excel第七行
        row = sheet.createRow(6);
        cell = row.createCell(0);
        cell.setCellValue("第11、12节课");
        //第二列
        cell = row.createCell(1);

        QueryWrapper<Schedule1> queryWrapper26 = new QueryWrapper<>();
        queryWrapper26.eq("teacher_name", teacher_name);
        queryWrapper26.like("number_sections","11");
        queryWrapper26.eq("weeks","一");
        Schedule1 schedule26 = schedule1Dao.selectOne(queryWrapper26);
        if(schedule26 == null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule26.getClasses_name()+"\n"+schedule26.getClass_weeks()+"\n"+schedule26.getCourse_name()+"\n"+schedule26.getScheduled_classroom());

        }
        //第三列
        cell = row.createCell(2);

        QueryWrapper<Schedule1> queryWrapper27 = new QueryWrapper<>();
        queryWrapper27.eq("teacher_name", teacher_name);
        queryWrapper27.like("number_sections","11");
        queryWrapper27.eq("weeks","二");
        Schedule1 schedule27 = schedule1Dao.selectOne(queryWrapper27);
        if(schedule27==null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule27.getClasses_name()+"\n"+schedule27.getClass_weeks()+"\n"+schedule27.getCourse_name()+"\n"+schedule27.getScheduled_classroom());

        }
        //第四列
        cell = row.createCell(3);

        QueryWrapper<Schedule1> queryWrapper28 = new QueryWrapper<>();
        queryWrapper28.eq("teacher_name", teacher_name);
        queryWrapper28.like("number_sections","11");
        queryWrapper28.eq("weeks","三");
        Schedule1 schedule28 = schedule1Dao.selectOne(queryWrapper28);
        if(schedule28==null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule28.getClasses_name()+"\n"+schedule28.getClass_weeks()+"\n"+schedule28.getCourse_name()+"\n"+schedule28.getScheduled_classroom());

        }
        //第五列
        cell = row.createCell(4);

        QueryWrapper<Schedule1> queryWrapper29 = new QueryWrapper<>();
        queryWrapper29.eq("teacher_name", teacher_name);
        queryWrapper29.like("number_sections","11");
        queryWrapper29.eq("weeks","四");
        Schedule1 schedule29 = schedule1Dao.selectOne(queryWrapper29);
        if(schedule29==null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule29.getClasses_name()+"\n"+schedule29.getClass_weeks()+"\n"+schedule29.getCourse_name()+"\n"+schedule29.getScheduled_classroom());

        }
        //第六列
        cell = row.createCell(5);
        QueryWrapper<Schedule1> queryWrapper30= new QueryWrapper<>();
        queryWrapper30.eq("teacher_name", teacher_name);
        queryWrapper30.like("number_sections","11");
        queryWrapper30.eq("weeks","五");
        Schedule1 schedule30 = schedule1Dao.selectOne(queryWrapper30);
        if(schedule30==null){
            cell.setCellValue("");
        }else{
            cell.setCellValue(schedule30.getClasses_name()+"\n"+schedule30.getClass_weeks()+"\n"+schedule30.getCourse_name()+"\n"+schedule30.getScheduled_classroom());
        }
        long filename = System.currentTimeMillis();
        SimpleDateFormat df = new SimpleDateFormat("yyMMddHHmmss");
        String fileName = df.format(new Date());
        response.setContentType("application/msexcel");
        response.setHeader("Content-disposition", "attachment; filename="+fileName+".xls");
        response.flushBuffer();
        wb.write(response.getOutputStream());
        ResponseEntity responseEntity;
        responseEntity=ResponseEntity.ok();
        responseEntity.putDataValue("msg","导出成功");
        return responseEntity;
    }
}
